<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/tag.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>公司列表</title>
<LINK rel="stylesheet" type="text/css" href="${baseurl}js/easyui/styles/default.css">
<%@ include file="/WEB-INF/views/common_css.jsp"%>
<%@ include file="/WEB-INF/views/common_js.jsp"%>
<script type="text/javascript">
	function deleteItems() {

		//将form的action指向删除商品的地址
		document.itemsForm.action = "${pageContext.request.contextPath }/user/deleteUser";

		//进行form提交
		document.itemsForm.submit();

	}
	
</script>
</head>
<body>
	<form name="itemsForm"
		action="${pageContext.request.contextPath }/user/queryUser"
		method="post">
		<table width="100%" border=1>
					<tr>
						<td>
						<input type="text" name="username" value="请输入公司名" onfocus="if(this.value==this.defaultValue){this.value=''}" onblur="if(this.value==''){this.value=this.defaultValue}"/>
						<input type="submit" value="查询" /> 
						&nbsp;&nbsp;
							<input type="button" value="批量删除" onclick="deleteItems()" />
						</td>
						<td>
							<input type="button" value="添加公司" onclick="javascript:createmodalwindow('添加公司',0.63,0.86,'${baseurl}company/add')"/>
						</td>
					</tr>
		</table>
		公司列表：
		<table width="100%" border=1 id="aaa">
			<tr>
				<td>选择</td>
				<td>公司名称</td>
				<td>创建日期</td>
				<td>操作</td>
			</tr>
			<c:forEach items="${companys }" var="item">
				<tr>
					<td><input type="checkbox" name="delete_id"
						value="${item.companyId}" /></td>
					<td>${item.companyName }</td>
					<td><fmt:formatDate value="${item.createtime}"
							pattern="yyyy-MM-dd HH:mm:ss" /></td>
					<td>
						<!-- 有item:update权限才显示修改链接，没有该 权限不显示，相当 于if(hasPermission(item:update)) -->
						<shiro:hasPermission name="user:update">
							<a href="javascript:javascript:createmodalwindow('修改用户',745,425,'${baseurl}user/edit/${item.companyId}')">修改公司名称</a>
						</shiro:hasPermission>
					</td>

				</tr>
			</c:forEach>

		</table>
	</form>
</body>
</html>